<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>classList中的classList</title>
		<style type="text/css">
			.light {
				background-color: #000;
			}
		</style>
	</head>
	<body>
		<button>切换</button>
		<script type="text/javascript">
			//获取boy对象
			var bd = document.body;
			var btn = document.querySelector('button');
			btn.addEventListener('click',function() {
				bd.classList.toggle('light')
			})
			
		</script>
	</body>
</html>
